home *** CD-ROM | disk | FTP | other *** search
/ MIDICraft's MIDINET CD-ROM / MIDICraft's MIDINET CD-ROM.iso / DOSUTILS / FILEDB.DOC < prev    next >
Text File  |  1997-01-18  |  8KB  |  216 lines

  1.         ******************************
  2.             FILEDB v1.1
  3.     
  4.        keep knowledge about already seen files
  5.               by Guenter Nagler 
  6.                 1996 
  7.           (gnagler@ihm.tu-graz.ac.at)
  8.         ******************************
  9.  
  10. [1] BACKGROUND
  11. When downloading files from newsgroups or ftp sites it often happened
  12. that I got same files from different locations and didn't notice it before
  13. looking at them (e.g. hearing a sound file or displaying a picture or starting
  14. a program). That costs much time when downloading frequently.
  15.  
  16. First I wrote a program FINDDBL that compared the files with those I have
  17. already picked. This helped because "good" files are stored on different sites
  18. and reposted often.
  19.  
  20. But I found that I spent much time with "bad" duplicates or reposts that 
  21. I already deleted.
  22. So I wrote this program to save time by keeping knowledge about already
  23. seen files in a small database and automatically find the duplicates.
  24.  
  25. Sure, I know that files are real duplicates only if you have compared 
  26. against the original, but keeping the "bad" original files is a bad solution.
  27.  
  28. This program uses only 62 bytes to identify a file duplicate:
  29.   - 4 bytes: file size
  30.   - 4 bytes: checksum of whole file
  31.   - 42 bytes: data from the original file picked up from different file positions
  32.   - 12 bytes: filename of the original file without path (dos compatible)
  33.  
  34. If the filename is not exactly the same, the program only suggests
  35. that it probably may be a duplicate file.
  36.  
  37. Experiences have shown that this assumption identifies file duplicates,
  38. and only very constructed file changes may cause wrong identification.
  39. Normally edited versions of a file lead to new checksum or file size.
  40.  
  41. [2] FILES DESCRIPTION
  42.  
  43. FILEDB.EXE..........MSDOS executable 
  44. FILEDB.DOC..........this file, showing usage of FILEDB.EXE
  45. only FILEDB.EXE is required to run program 
  46.  
  47. [3] COPYRIGHT
  48.  
  49. FILEDB (c) 1996 was created by Guenter Nagler.
  50.  
  51. FILEDB is free and may be used as you wish with this one exception:
  52.  
  53.     You may NOT charge any fee or derive any profit for distribution
  54.     of FILEDB.  Thus, you may NOT sell or bundle FILEDB with any 
  55.     product in a retail environment (shareware disk distribution, CD-ROM,
  56.     etc.) without permission of the author.
  57.  
  58. You may give FILEDB to your friends, upload it to a BBS, or ftp it to
  59. another internet site, as long as you don't charge anything for it.
  60.  
  61. [4] DISCLAIMER
  62.  
  63. FILEDB handles data base files that keep knowledge about already seen
  64. files and gives answer about having seen files.
  65.  
  66. Use FILEDB at your own risk.  Anything you do with FILEDB is your
  67. responsibility, and not the author's.  Any damage caused to any person,
  68. computer, software, hardware, company, or business by running FILEDB 
  69. is your responsibility, and the author will not be liable.
  70.  
  71. If you don't understand these terms, or are not sure of something, or
  72. are afraid something bad might come of using FILEDB, don't  use  it!
  73. You are here forewarned.
  74.  
  75. [5] INSTALLATION 
  76.  
  77. Simply copy FILEDB.EXE in a directory that is in your path.
  78.  
  79. Call it in a batch file to use knowledge databases with certain path and name
  80. e.g. mididup.bat:
  81. ECHO OFF
  82. FILEDB -f c:\midifile.db %1 %2 %3 %4 %5 %6 %7 %8 %9
  83.  
  84. FILEDB will use FILEKNOW.DB in current directory as default database (that
  85. is empty at beginning).
  86.  
  87. [6] USAGE
  88.  
  89. usage: filedb [-a] [-c] [-del] [-f name] [-r name] [-s] [-o [#]] [-R] [-dir] filemask ...
  90. -a      add files                                                               
  91. -c      count files                                                             
  92. -f      use other file as database (default: fileknow.db)                       
  93. -r      remove knowledge about file
  94. -del    delete files that are already known                                     
  95. -s      affects matching files in subdirectories                                
  96. -o [#]  optimize database at given level (reducing less used entries)
  97. -dir    list matching files                                                     
  98. -R      repair corrupt database (save before!)                                  
  99.  
  100. The parameters in brackets [ ] are optional.
  101. FILEDB needs one or more existing filenames as parameters (Wildcards *, ? are allowed)
  102.  
  103. FILEDB supports following commands:
  104. * default command is asking database if the filenames are known
  105.   e.g. filedb *.bmp
  106. * adding files to the knowledge database (-a)
  107.   e.g. filedb -a *.bmp
  108. * get count of known files (now filename needed)
  109.   filedb -c
  110. * use certain file on certain location as database
  111.   e.g. filedb -f c:\pictures\pictures.db
  112.   FILEDB  uses the file .\fileknow.db as database.
  113.  
  114. Warning: The file will be changed. The file should be writable.
  115.     Always create a new database when starting certain file knowledge.
  116.  
  117. * remove known file information to given filenames
  118.   e.g. filedb -r filename.ext
  119.  
  120. * delete already seen files (duplicates)
  121.   e.g. filedb -del *.*
  122.   only the files that are already known (read assumption in [1])
  123.   are deleted.
  124.   The program asks for y/n if the duplicate has other filename.
  125.  
  126. * perform action also with matching files in subdirectories
  127.   e.g. filedb -s *.exe
  128.   This will ask database if all *.exe files in current directory and subdirecties
  129.   are known.
  130.  
  131. * optimize database
  132.   if database becomes too large and you want to make it smaller then
  133.   you could shrink it by deleting all file information that was added
  134.   and never seen as duplicate
  135.   e.g. filedb -o 1
  136.   This command does recognize any filename parameters.
  137.  
  138. * list content of a file knowledge database
  139.   e.g. filedb -dir *.*
  140.  
  141.   This command does not check if the given filename parameters are
  142.   existing, it lists the information when a matching filename is found
  143.   in the database.
  144.   Its comparable to DOS  DIR command or UNIX ls.
  145.  
  146. * repair a database that is damaged.
  147.  
  148.   If harddisk failure damaged part of the database the command
  149.   trys to collect the remaining valid file information and generates
  150.   a repaired database. Hope you will not need this command.
  151.  
  152.   e.g. filedb -R
  153.  
  154. You can get the program version by hidden option -verbose .
  155.  
  156. [7] EXAMPLE
  157.  
  158. command> uex *.uh
  159.   uex reads all files matching *.uh and extracts binary data from encoded
  160.   articles.
  161.  
  162. command> cd result
  163.   directory result contains all successful output files.
  164.  
  165. command> play file.mid
  166.   look at the files in this directory
  167.  
  168.   copy good files into other directory
  169.  
  170. command> copy good.mid g:\archive\midi
  171.   and FILEDB the file in result 
  172. command> FILEDB good.mid
  173. FILEDBed in GOOD1.UH 
  174. FILEDBed in GOOD2.UH 
  175. FILEDBed in GOOD3.UH 
  176. good.mid deleted
  177.  
  178. GOOD*.UH remain but only contain the mail header, description
  179.  
  180. Create a batch file to simplify the use    for midi database:
  181. File mididb.bat:
  182. @echo off
  183. filedb -f c:\midi.db %1 %2 %3 %4 %5 %6 %7 %8 %9
  184.  
  185. command>mididb *.mid
  186.  
  187. Create a batch file to simplify deleting duplicate midi files in current directory:
  188. File delmidi.bat:
  189. @echo off
  190. filedb -f c:\midi.db -del *.mid
  191.  
  192. command> delmidi
  193.  
  194. All files not seen till now remain in the directory.
  195. The remaining files are not registered as seen in the midi.db database.
  196. To register seen you also need to specify option -a (add).
  197.  
  198. Filedb works with any data type (not limited to midi or a sound format).
  199.  
  200. [8] SUGGESTIONS / COMMENTS / BUG REPORTS
  201.  
  202.          WWW:    http://hgiicm.tu-graz.ac.at/Cpub
  203.          EMAIL:  gnagler@ihm.tu-graz.ac.at
  204.  
  205. [9] CHANGES
  206. v1.0 to v1.1:
  207.   * added delete command a "delete all" when user asked if file should be 
  208.     deleted? After pressing key "a" all other files that are known are automatically
  209.     deleted without asking user again.
  210.   * bug fixed when using options -del and -a at same time
  211.     (first deleted file if seen and then tried to add the deleted file)
  212.     New behavior:
  213.       -del     deletes file if already seen (asks user in case of filename is new)
  214.       -a       adds file if not seen yet (otherwise tells already seen info)
  215.       -del -a  deletes file if already seen, otherwise adds file without deleting file
  216.